with open('input.txt') as file:
    jolts = [int(line) for line in file.readlines()]
    jolts.sort()
    jolts = [0] + jolts + [jolts[-1] + 3]

    ones = threes = 0

    for (a, b) in zip(jolts, jolts[1:]):
        if b - a == 1:
            ones += 1
        if b - a == 3:
            threes += 1
        
    print(ones * threes)